package WebModule::Wcity;

use strict;

use base qw(WebModule);

__PACKAGE__->meta->setup(
    table   => 'wcity',

    columns => [
        id       => { type => 'serial', not_null => 1 },
        province => { type => 'integer', not_null => 1 },
        city     => { type => 'varchar', length => 25, not_null => 1 },
        wurl     => { type => 'varchar', length => 245, not_null => 1 },
    ],

    primary_key_columns => [ 'id' ],

    unique_key => [ 'city' ],

    foreign_keys=>[
        province=>{
            class=>'WebModule::Wprovince',
            key_columns=>{ province=>'id'},
        },
    ],

    relationships=>[
        fprovince=>{
            type=>'many to one',
            class=>'WebModule::Wprovince',
            column_map=>{ province=>'id'},
        }
    ],
);

1;

